import request from '@/utils/request';

/**
 * 根据主键ID查询顾客时间线记录
 * @param {number} rid 主键ID
 * @return {Promise}
 */
export function getTimelineRecordById(rid) {
  return request({
    url: 'txs/record',
    method: 'get',
    params: { rid },
  });
}

/**
 * 查询顾客会诊时间线
 * @param {number} cid 主键ID
 * @return {Promise}
 */
export function getClerkOrderRecord(cid) {
  return request({
    url: 'txs/record/order/list',
    method: 'get',
    params: { cid },
  });
}

/**
 * 跟进会诊
 * @param {Object} params
 * @return {Promise}
 */
export function replyOrderRecord(params) {
  return request({
    url: 'txs/record/order/reply',
    method: 'put',
    params: params,
  });
}

/**
 * 跟进会诊(音频), 仅教练用
 *
 * @param {FormData} formData
 * @return {Promise}
 */
export function replyOrderAudio(formData) {
  return request({
    url: 'txs/record/order/audio',
    method: 'post',
    data: formData,
  });
}

/**
 * 关闭会诊
 * @param {Object} params
 * @return {Promise}
 */
export function closeOrderRecord(params) {
  return request({
    url: 'txs/record/order/close',
    method: 'put',
    params: params,
  });
}
